package com.yunao.commons.serachcore.utils.lock;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;

public class RedisLock extends RedisBaseLock implements Lock {
	
	public RedisLock(String lockKey) {
		super(lockKey);
	}

	@Override
	public void lock() {
		try {
			tryLock(0, null);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}

	@Override
	public void lockInterruptibly() throws InterruptedException {

	}

	@Override
	public boolean tryLock() {
		return false;
	}

	@Override
	public boolean tryLock(long time, TimeUnit unit) throws InterruptedException {
		return tryGetLock(time, unit);
	}

	@Override
	public void unlock() {
		super.releaseLock();
	}

	@Override
	public Condition newCondition() {
		return null;
	}

}

